package org.lego.biz.task.management.base.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.lego.biz.task.management.base.entity.base.UUIDWithTimeAndStatusEntity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

/**
 * Created by hr.qjy on 16/11/18.
 * 任务模块
 */
@Entity
@Table(name = "biz_task_module")
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class TaskModule extends UUIDWithTimeAndStatusEntity {
    @OneToMany(mappedBy = "taskModule")
    //@JoinColumn(name = "module_id")
    @JsonIgnore
    private List<Task> tasks;
    @OneToMany
    @JoinColumn(name = "module_id")
    private List<TaskInventory> taskInventories;  // 清单列表(外键,单向一对多)
}
